/*
 * @Author: yushuang
 * @Date: 2024-12-17 18:07:09
 * @LastEditors: yushuang
 * @LastEditTime: 2024-12-18 10:50:32
 * @Description:
 */
import { get } from 'lodash-es';
import router from '@/router';

export function getQueryParam(param: string | string[], defaultVal = '') {
  const query = router.currentRoute.value?.query ?? {};
  const val = get(query, param) ?? defaultVal;
  return decodeURIComponent(val);
}
